package com.zp.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;

/**
 * create news entity with properties
 * 
 * @version 1.0
 * 
 * @since 1.0
 * 
 * @author chenlijun08@gmail.com
 * 
 * @date 2014/2/22
 * 
 */
@XmlRootElement
@Entity
@Table(catalog = "zzyyp", name = "tb_content")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Content implements Serializable {

	private static final long serialVersionUID = 1L;
	private int id;
	// news title
	private String title;
	// path of title image
	private String titleImage;
	// content of content
	private String content;
	// who publish this content
	private String author;
	// where the content come from
	private String source;
	// code of Type
	private String typeCode;
	private String status;
	private Date createTime;
	// update time
	private Date operationTime;
	// path of media
	private String mediaPath;
	// code of Type
	private String mediaType;
	// whether stick
	private String top;

	private String summary;
	private String titleImageMin;

	@Id
	@GenericGenerator(name = "generator", strategy = "identity")
	@GeneratedValue(generator = "generator")
	@Column(nullable = false, name = "news_id", unique = true)
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@Column(length = 50, nullable = false, name = "news_title")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(nullable = false, name = "news_content")
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(nullable = false, name = "news_create_time")
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(length = 100, name = "news_source")
	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}

	@Column(length = 1, name = "news_status")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "news_operation_time")
	public Date getOperationTime() {
		return operationTime;
	}

	public void setOperationTime(Date operationTime) {
		this.operationTime = operationTime;
	}

	@Column(length = 255, name = "news_title_image")
	public String getTitleImage() {
		return titleImage;
	}

	public void setTitleImage(String titleImage) {
		this.titleImage = titleImage;
	}

	@Column(nullable = false, length = 20, name = "news_author")
	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	@Column(length = 20, name = "news_type_code")
	public String getTypeCode() {
		return typeCode;
	}

	public void setTypeCode(String typeCode) {
		this.typeCode = typeCode;
	}

	@Column(length = 255, name = "news_media_path")
	public String getMediaPath() {
		return mediaPath;
	}

	public void setMediaPath(String mediaPath) {
		this.mediaPath = mediaPath;
	}

	@Column(length = 20, name = "news_media_type")
	public String getMediaType() {
		return mediaType;
	}

	public void setMediaType(String mediaType) {
		this.mediaType = mediaType;
	}

	@Column(length = 1, name = "news_top")
	public String getTop() {
		return top;
	}

	public void setTop(String top) {
		this.top = top;
	}

	@Column(length = 200, name = "news_summary")
	public String getSummary() {
		return summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}

	@Column(length = 255, name = "news_title_image_min")
	public String getTitleImageMin() {
		return titleImageMin;
	}

	public void setTitleImageMin(String titleImageMin) {
		this.titleImageMin = titleImageMin;
	}

}
